//
//  HMSportSportingViewController.m
//  LetsGo
//
//  Created by 段立峰 on 2016/11/9.
//  Copyright © 2016年 段立峰. All rights reserved.
//

#import "HMSportSportingViewController.h"
#import "HMSportMapViewController.h"
@interface HMSportSportingViewController ()

@end

@implementation HMSportSportingViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor yellowColor];
    [self setupMapViewController];
    
    
}
/*
 
 设置地图视图控制器
 
 */
-(void)setupMapViewController{
    
    //1.实例化地图控制器
    HMSportMapViewController *vc =[HMSportMapViewController new];
    //2.添加到当前控制器的子控制器
    [self addChildViewController:vc];
    //3.将地图控制器的视图，添加到当前视图
    [self.view addSubview:vc.view];
    vc.view.frame = self.view.bounds;
    
    //设置运动类型
//    vc.sportType = _sportType;
    
    // 设置运动轨迹模型
    vc.sportTracking = [[HMSportTracking alloc] initWithType:_sportType];
    
    //4.完成控制器的添加
    [vc didMoveToParentViewController:self];
    
    
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
